<style>
body #eb-dg-footerwrapper {
	bottom:0;
	color:#111111;
	font-size:11px;
	height:30px;
	padding:0;
	position:fixed;
	right:0;
	width:100%;
	z-index:99;
	background-color:#FFFFFF;
	border-top:1px solid #6B90DA;
}

#eb-dg-tabs-menu,#eb-dg-model-menu,#eb-dg-context-menu {
    font: bold 11px verdana, arial, sans-serif;
    list-style-type: none;
    padding-bottom: 25px;
    border-bottom: 2px solid #EBEFF9;
    margin: 0;
}

#eb-dg-model-menu,#eb-dg-context-menu
{
border-right: 2px solid #EBEFF9;
border-bottom: 0px solid #EBEFF9;
height:280px;
margin-top:15px;
}

#eb-dg-tabs-menu A, #eb-dg-model-menu A,#eb-dg-context-menu A {
    float: left;
	display:block;
	width:80px;
	padding-left:5px;
    height: 25px;
	line-height:25px;
    margin: 2px 2px 0 10px;
	color:#0000CC;
	text-decoration:underline;
}

#eb-dg-model-menu A,#eb-dg-context-menu A
{
	width:145px;
}

#eb-dg-tabs-menu LI.active A, #eb-dg-model-menu LI.active A, #eb-dg-context-menu LI.active A
{
    background-color: #EBEFF9;
	color:#000000;
	font-weight:bold;
	text-decoration:none;	
}


</style>

<div id="eb-dg-footerwrapper">
	<div id="eb-dg-footer">
		<table style="width:100%" cellpadding="0" cellspacing="0">
			<tr style="height:30px;">
				<td onclick="$('#eb-dg-footerwrapper').animate({height:300},500);">
					<?php eb_widget("ViewStack", array("target" => "eb-dg-tabs"));?>
				</td>
				<td style="width:100px;" style="font-weight:bold;text-decoration:none;">
					<a href="/eb-admin">Eb-Admin</a> | 
					<a href="#" onclick="$('#eb-dg-footerwrapper').animate({height:30},500);">[-]</a>
					<a href="#" onclick="$('#eb-dg-footerwrapper').hide()">[x]</a>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<div id="eb-dg-tabs" style="background-color:#FFFFFF;display:block;">
						<div name="Model">
							<div style="float:left;width:200px;height:100%;display:block;">
								<?php eb_widget("ViewStack", array("target" => "eb-dg-model"));?>
							</div>
							<div id="eb-dg-model" style="width:100%;padding-left:210px;">
								<div name="List of Queries">
									<ul><?php eb_widget("list",array("dataProvider" => EbDebug::$listQueries, "itemRenderer" => '<li>$item</li>')); ?></ul>
								</div>
								<div name="List of Models">
									<ul><?php eb_widget("list",array("dataProvider" => EbDebug::$listModels, "itemRenderer" => '<li>$item</li>')); ?></ul>
								</div>
							</div>
						</div>
						<div name="View" style="display:none;">
							<div style="float:left;width:200px;height:100%;display:block;">
								<?php eb_widget("ViewStack", array("target" => "eb-dg-view"));?>
							</div>
							<div id="eb-dg-view" style="overflow:scroll;height:290px;">
								<div name="Page" style="">
									<?php echo eb_var_dump(EbDebug::$listObjects["page"]);?>
								</div>							
								<div name="List of Fragments">
									<ul><?php eb_widget("list",array("dataProvider" => EbView::$listFragments, "itemRenderer" => '<li>$id</li>')); ?></ul>
								</div>
							</div>
						</div>
						<div name="Controller" style="display:none;overflow:scroll;height:290px;">
							<ul><?php echo eb_var_dump(EbDebug::$listCommands); ?></ul>
						</div>
						<div name="Context" style="display:none;">
							<div style="float:left;width:200px;height:100%;display:block;">
								<?php eb_widget("ViewStack", array("target" => "eb-dg-context"));?>
							</div>
							<div id="eb-dg-context" style="overflow:scroll;height:290px;">
								<div name="Optimization">
									<ul><?php 
										echo '<li>Before Memory: '.formatFilesize(EbDebug::$beforeMemory).'</li>';
										echo '<li>After Memory: '.formatFilesize(EbDebug::$afterMemory).'</li>';
										echo '<li>Memory Usage: '.formatFilesize(EbDebug::$afterMemory - EbDebug::$beforeMemory).'</li>';		
										echo '<li>Peak Memory: '.formatFilesize(EbDebug::$peakMemory).'</li>';	
										echo '<li>Generated Time: '.EbDebug::$generatedTime.'</li>';										
									?></ul>
								</div>							
								<div name="Http Request">
									<?php echo eb_var_dump(EbController::$request);?>
								</div>
								<div name="Http Response">
									<?php echo eb_var_dump(EbController::$response);?>
								</div>
								<div name="Http Session">
									<?php echo eb_var_dump($_SESSION);?>
								</div>
								<div name="Cookies">
									<?php echo eb_var_dump($_COOKIE);?>
								</div>	
								<div name="Php">
									<?php echo eb_var_dump(phpinfo_array());?>
								</div>								
							</div>
						</div>
						<div name="Console" style="display:none;overflow:scroll;height:290px;">
							<?php eb_widget("list",array("dataProvider" => EbDebug::$listLogMessages, "itemRenderer" => '$item <br /><br />')); ?>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
</div>

<?php 

function phpinfo_array($return=false){
 /* Andale!  Andale!  Yee-Hah! */
 ob_start(); 
 phpinfo(-1);
 
 $pi = preg_replace(
 array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms',
 '#<h1>Configuration</h1>#',  "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#',
 "#[ \t]+#", '#&nbsp;#', '#  +#', '# class=".*?"#', '%&#039;%',
  '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>'
  .'<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#',
  '#<h1><a href="(?:.*?)\?=(.*?)">PHP Credits</a></h1>#',
  '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#',
  "# +#", '#<tr>#', '#</tr>#'),
 array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ',
  '<h2>PHP Configuration</h2>'."\n".'<tr><td>PHP Version</td><td>$2</td></tr>'.
  "\n".'<tr><td>PHP Egg</td><td>$1</td></tr>',
  '<tr><td>PHP Credits Egg</td><td>$1</td></tr>',
  '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" .
  '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'),
 ob_get_clean());

 $sections = explode('<h2>', strip_tags($pi, '<h2><th><td>'));
 unset($sections[0]);

 $pi = array();
 foreach($sections as $section){
   $n = substr($section, 0, strpos($section, '</h2>'));
   preg_match_all(
   '#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#',
     $section, $askapache, PREG_SET_ORDER);
   foreach($askapache as $m)
       $pi[$n][$m[1]]=(!isset($m[3])||$m[2]==$m[3])?$m[2]:array_slice($m,2);
 }

 return $pi;
}

function formatFilesize($value)
{
	return ($value / 1024). 'Ko';	
}

?>